package customview.ike.com.customviewproject.utils.recycleViewCommonUtils.MultiItemAdapter;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by ike on 2017/9/18.
 * 分割线
 */

public class CloudItemDecoration extends RecyclerView.ItemDecoration{
    int defaultSpace=20;
    public boolean isTopMargin=false;

    public CloudItemDecoration(int defaultSpace) {
        this.defaultSpace = defaultSpace;
    }
    public CloudItemDecoration() {
      
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        super.getItemOffsets(outRect, view, parent, state);
        if (isTopMargin){
            outRect.top=defaultSpace;
        }else {
            outRect.bottom=defaultSpace;
        }
      
    }
    
}
